home *** CD-ROM | disk | FTP | other *** search
/ Greenhouse Effect Detection Expriment / NASA Greenhouse Effect Detection Expriment 1992 - Disc 2.iso / software / dos / cdf22pc / src / include / wfl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-03  |  7.0 KB  |  233 lines

  1. /******************************************************************************
  2. *
  3. *  NSSDC/CDF                        Header file for WFL.
  4. *
  5. *  Version 1.3, 4-Mar-92, ST Systems (STX)
  6. *
  7. *  Modification history:
  8. *
  9. *   V1.0  24-Jan-91, D Grogan/H Leckner     Original version (for CDF V2.0).
  10. *   V1.1  25-Mar-91, J Love         Remove include of stdlib.h
  11. *   V1.2  11-Sep-91, J Love         Modified for IBM-PC port.
  12. *   V1.3   4-Mar-92, H Leckner         IBM PC port.  CDF V2.2.
  13. *             J Love
  14. *
  15. ******************************************************************************/
  16.  
  17. #include <stdio.h>
  18. #include "window.h"
  19.  
  20. #if defined(vms) | defined(__MSDOS__)
  21. typedef int (*CFP)(int *, int *, int *);
  22. #endif
  23. #if defined(unix)
  24. typedef int (*CFP)();
  25. #endif
  26.                            /*CodeRef-mark*/
  27. #define SCREEN_WIDTH   80
  28. #define SCREEN_HEIGHT  22
  29.  
  30. #ifdef vms
  31. #define ROW_OFFSET 0
  32. #define COL_OFFSET 0
  33. #define MIN_ROW 2
  34. #endif
  35.  
  36. #if defined(unix) | defined(ultrix) | defined(__MSDOS__)
  37. #define ROW_OFFSET 2
  38. #define COL_OFFSET 2
  39. #define MIN_ROW 0
  40. #endif
  41.  
  42.   /*
  43.    *     Data types recognized for use in input forms.
  44.    */
  45.  
  46. #define DT_CHAR        1
  47. #define DT_STRING        2
  48. #define DT_SHORTINT    3
  49. #define DT_LONGINT       4
  50. #define DT_FLOAT         5
  51. #define DT_DOUBLE    6
  52.  
  53.   /*
  54.    *     Constants for struct form_element_struct.type
  55.    *     These declare the type of form, not a data type.
  56.    */
  57. #define DUMMY_FORM     0L
  58. #define NO_CALLBACK    1L
  59. #define MENU_CALLBACK  2L
  60. #define FORM_CALLBACK  3L
  61.  
  62.    /*
  63.     *   fundamental WFL structures
  64.     */
  65.  
  66. struct    window_struct
  67.     {
  68.     WINDOWid    wind_id;
  69.     int    start_row;
  70.     int    start_col;
  71.     int    num_rows;
  72.     int    num_cols;
  73.     char        label[SCREEN_WIDTH * 2];
  74.     };
  75.  
  76. struct menu_element_struct
  77.     {
  78.     int    start_row;
  79.     int     start_col;
  80.     char    label[SCREEN_WIDTH * 2];
  81.     };
  82.  
  83. struct form_element_struct
  84.     {
  85.     int    start_row;
  86.     int    start_col;
  87.     char         label[SCREEN_WIDTH * 2];
  88.     int    length_label;
  89.     int    length_field;
  90.     int    type;
  91.     char        *popup;
  92.     CFP        callback;
  93.     };
  94.  
  95.  
  96. /*
  97.  *    A union structure that overlays all types for
  98.  *    output interpretation.
  99.  *      (This struct and method taken from CDF Tool Kit.)
  100.  */
  101.  
  102. union    ALLTYPES
  103.         {
  104.         short    int2;
  105.         long    int4;
  106.         float    real4;
  107.         double    real8;
  108.         char    byte[1024];
  109.         };
  110. #if !defined(unix)
  111. void WFL_init(void);
  112. void WFL_close(void);
  113. void WFL_message_init(struct  window_struct    *mess_ptr);
  114. void WFL_message_display (struct  window_struct    *c,
  115.             char message[], int beep);
  116. void WFL_begin_screen_update (void);
  117. void WFL_end_screen_update (void);
  118. void WFL_create_window( struct  window_struct    *c);
  119. void WFL_delete_window(struct  window_struct    *c);
  120. void WFL_draw_window (struct  window_struct   *window_ptr);
  121. void WFL_erase_window (struct  window_struct   *window_ptr);
  122. void WFL_erase_display (struct window_struct  *window_ptr);
  123. void WFL_begin_display_update (struct  window_struct   *window_ptr);
  124. void WFL_end_display_update (struct  window_struct   *window_ptr);
  125. #if !defined(vms)
  126. void WFL_end_display_update_nobox(struct  window_struct   *window_ptr);
  127. #endif
  128. void WFL_change_window_length ( struct  window_struct    *c, int    length);
  129. void WFL_change_window_width ( struct  window_struct    *c, int    width);
  130. void WFL_change_window_loc ( struct  window_struct *c, int x, int y);
  131. void WFL_menu_element (char data_ptr[],
  132.                struct  menu_element_struct  *element_ptr[],
  133.                int num_elements, int *number, int *rcode);
  134. void WFL_menu_string (int index, struct  menu_element_struct *element_ptr[],
  135.               char    string[]);
  136. void WFL_load_menu (struct  menu_element_struct  *element_ptr[],
  137.         int num_elements, struct  window_struct *window_ptr,
  138.         int rowOffset, int colOffset);
  139. long int WFL_read_menu (struct  menu_element_struct *element_ptr[],
  140.             int  num_elements,
  141.             struct  window_struct *window_ptr,
  142.             int *menu_choice, int *windowHead, int highlight);
  143. long int WFL_new_dyna_window (struct window_struct  **window,
  144.                 char *banner);
  145. void WFL_delete_dyna_window (struct window_struct *window);
  146. void WFL_set_dyna_window (int startRow, int startCol, int maxRows,
  147.              char *element_list[], struct window_struct *window);
  148. long int WFL_new_dyna_elem_list (
  149.         struct menu_element_struct *menu_element_ptr[],
  150.         char   *element_list[]);
  151. struct menu_element_struct **WFL_new_dyna_menu (char *element_list[]);
  152. void WFL_delete_dyna_menu (struct menu_element_struct   **ptr,
  153.                 char  *element_list[]);
  154. int WFL_popup_menu ( int startRow, int startCol,
  155.               int maxRows,
  156.               char  *banner, char *element_list[],
  157.               long int    *user_selection, int  menu_id,
  158.               int    highlight);
  159. void WFL_load_form (struct  form_element_struct  *element_ptr[],
  160.     int num_elements, struct  window_struct  *window_ptr);
  161. long int WFL_rove_form (int keyboard_code, int *current_element,
  162.         int lo, int hi, int increment);
  163. void WFL_generic_form (struct  window_struct *window_ptr,
  164.                struct  form_element_struct *element_ptr[],
  165.                char label[], int data_len);
  166. void WFL_display_form_data (struct  window_struct          *window_ptr,
  167.                 struct  form_element_struct *element_ptr[],
  168.                 int    *data, int  data_type,
  169.                 int    element_num, int video_type);
  170. void WFL_read_element ( struct  window_struct  *window_ptr,
  171.             struct  form_element_struct *element_ptr[],
  172.             int    *data, int  data_type,
  173.             int    element_num, int *rcode);
  174. void WFL_create_popup (struct    window_struct         **c);
  175. void WFL_set_popup_window (struct window_struct *window_ptr,
  176.                struct    window_struct *parent_ptr,
  177.                struct  form_element_struct *element_ptr[],
  178.                int element_num, int    num_elements);
  179. void WFL_popup_connect ( struct  form_element_struct      *element_ptr[],
  180.             int element_num, int *context_ptr, CFP callback_ptr);
  181. void WFL_get_popup_pointer (struct  form_element_struct    *element_ptr[],
  182.         int element_num, int **context_ptr);
  183. void WFL_read_callback(CFP callback_ptr, int *popup, int *data, int *rcode);
  184. long int WFL_popup_info ( int startRow, int startCol, int maxRows,
  185.               char *banner, char *element_list[],
  186.               struct window_struct **window_ptr);
  187. void WFL_put_dyna_info (struct window_struct  *window_ptr,
  188.            char   *element_list[]);
  189. #else
  190. void WFL_init();
  191. void WFL_close();
  192. void WFL_message_init();
  193. void WFL_message_display ();
  194. void WFL_begin_screen_update ();
  195. void WFL_end_screen_update ();
  196. void WFL_create_window();
  197. void WFL_delete_window();
  198. void WFL_draw_window ();
  199. void WFL_erase_window ();
  200. void WFL_erase_display ();
  201. void WFL_begin_display_update ();
  202. void WFL_end_display_update ();
  203. void WFL_end_display_update_nobox();
  204. void WFL_change_window_length ();
  205. void WFL_change_window_width ();
  206. void WFL_change_window_loc ();
  207. void WFL_menu_element ();
  208. void WFL_menu_string ();
  209. void WFL_load_menu ();
  210. long int WFL_read_menu ();
  211. long int WFL_new_dyna_window ();
  212. void WFL_delete_dyna_window ();
  213. void WFL_set_dyna_window ();
  214. long int WFL_new_dyna_elem_list ();
  215. struct menu_element_struct **WFL_new_dyna_menu ();
  216. void WFL_delete_dyna_menu ();
  217. int WFL_popup_menu ();
  218. void WFL_load_form ();
  219. long int WFL_rove_form ();
  220. void WFL_generic_form ();
  221. void WFL_display_form_data ();
  222. void WFL_read_element ();
  223. void WFL_create_popup ();
  224. void WFL_set_popup_window ();
  225. void WFL_popup_connect ();
  226. void WFL_get_popup_pointer ();
  227. void WFL_read_callback();
  228. long int WFL_popup_info ();
  229. void WFL_put_dyna_info ();
  230. #endif
  231.  
  232.  
  233.